package com.googlecode.ws.tester.xor.wsdl.model;

import java.util.List;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: pablo
 * Date: 2009-06-28
 * Time: 13:36:33
 */
public class PortType {
    private String name;
    private Documentation documentation;
    private List<Operation> operations;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Documentation getDocumentation() {
        return documentation;
    }

    public void setDocumentation(Documentation documentation) {
        this.documentation = documentation;
    }

    public List<Operation> getOperations() {
        return operations;
    }

    public void setOperations(List<Operation> operations) {
        this.operations = operations;
    }

    public void addOperation(Operation operation) {
        if(operations==null) {
            operations= new ArrayList<Operation>();
        }
        operations.add(operation);
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("PortType");
        sb.append("{name='").append(name).append('\'');
        sb.append(", documentation=").append(documentation);
        sb.append(", operations=").append(operations);
        sb.append('}');
        return sb.toString();
    }
}
